<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix ="spring" uri = "http://www.springframework.org/tags" %>
<%@ taglib uri="/WEB-INF/out-tabs.tld" prefix="out" %>
<script type="text/javascript" src="<c:url value="/static/js/repeat-dates.js"/>"></script>
<link rel="stylesheet" type="text/css" href="<c:url value="/static/css/repeat-dates.css"/>"></link>
<div>
	<div>
		<a id="edit_repeat_dates"><spring:message code="label.edit"></spring:message></a>
		<a id="remove_repeat_dates"><spring:message code="label.delete.all"></spring:message></a>
	</div> 
	
	<div id="date_repeat_edition_box" style="display: none;">
		<input type="hidden" value="" id="date_in_edition">
		<div class="date_repeat_container">
		<div class="nano">
		<div  class="content">	
		<c:set var="index" value="1"></c:set>
		<c:forEach items="${dates}" var="date" begin="1" varStatus="status" >
			<div class="repeat_date" id="date_${status.index}">
				<span class="description">
					<span>from </span><span id="date_repeat_from_${status.index}"><out:date  date="${date.startDate}" timezoneId="${timezone}" includeTime="true"></out:date></span> 
					<span>to </span><span id="date_repeat_to_${status.index}"><out:date date="${date.endDate}" timezoneId="${timezone}" includeTime="true"></out:date></span>
				</span>
				<c:if test="${date.editable}">
					<span class="controls">
						<span class="tiny-button-class edit_repeat_date"><spring:message code="label.edit"></spring:message></span>
						<span class="tiny-button-class delete_repeat_date" ><spring:message code="label.delete"></spring:message></span>
					</span>
				</c:if>
				<input type="hidden" name="days[${status.index}].startDay"  value="${date.startDay}">
				<input type="hidden" name="days[${status.index}].startHour" value="${date.startHour}">
				<input type="hidden" name="days[${status.index}].startMinute" value="${date.startMinute}">
				<input type="hidden" name="days[${status.index}].endDay" 	value="${date.endDay}">
				<input type="hidden" name="days[${status.index}].endHour" 	value="${date.endHour}">
				<input type="hidden" name="days[${status.index}].endMinute" 	value="${date.endMinute}">
			</div>
		</c:forEach>
		</div>
		</div>
		</div>
		<div id="date_repeat_edition">
			<div class="form_row">
				<div><spring:message code="label.date.from"></spring:message></div>
				<div>
					<input type="text" class="calendar-widget" id="date_repeat_start" />
					<select id="hourFrom">
						<option value="<%= 1 * 3600000%>">01</option>
		 				<option value="<%= 2 * 3600000%>">02</option>
		 				<option value="<%= 3 * 3600000%>">03</option>
		 				<option value="<%= 4 * 3600000%>">04</option>
		 				<option value="<%= 5 * 3600000%>">05</option>
		 				<option value="<%= 6 * 3600000%>">06</option>
		 				<option value="<%= 7 * 3600000%>">07</option>
		 				<option value="<%= 8 * 3600000%>">08</option>
		 				<option value="<%= 9 * 3600000%>">09</option>
		 				<option value="<%= 10 * 3600000%>">10</option>
		 				<option value="<%= 11 * 3600000%>">11</option>
		 				<option value="<%= 12 * 3600000%>">12</option>
		 				<option value="<%= 13 * 3600000%>">13</option>
		 				<option value="<%= 14 * 3600000%>">14</option>
		 				<option value="<%= 15 * 3600000%>">15</option>
		 				<option value="<%= 16 * 3600000%>">16</option>
		 				<option value="<%= 17 * 3600000%>">17</option>
		 				<option value="<%= 18 * 3600000%>">18</option>
		 				<option value="<%= 19 * 3600000%>">19</option>
		 				<option value="<%= 20 * 3600000%>">20</option>
		 				<option value="<%= 21 * 3600000%>">21</option>
		 				<option value="<%= 22 * 3600000%>">22</option>
		 				<option value="<%= 23 * 3600000%>">23</option>
					</select>:
					<select id="minuteFrom">
						<option value="<%= 0 * 60000%>">00</option>
		 				<option value="<%= 5 * 60000%>">05</option>
		 				<option value="<%= 10 * 60000%>">10</option>
		 				<option value="<%= 15 * 60000%>">15</option>
		 				<option value="<%= 20 * 60000%>">20</option>
		 				<option value="<%= 25 * 60000%>">25</option>
		 				<option value="<%= 30 * 60000%>">30</option>
		 				<option value="<%= 35 * 60000%>">35</option>
		 				<option value="<%= 40 * 60000%>">40</option>
		 				<option value="<%= 45 * 60000%>">45</option>
		 				<option value="<%= 50 * 60000%>">50</option>
		 				<option value="<%= 55 * 60000%>">55</option>
					</select>
				</div>
			</div>
			<div class="form_row">
				<div><spring:message code="label.date.to"></spring:message></div>
				<div>
				<input type="text" class="calendar-widget" id="date_repeat_end" />
				<select id="hourTo">
					<option value="<%= 1 * 3600000%>">01</option>
	 				<option value="<%= 2 * 3600000%>">02</option>
	 				<option value="<%= 3 * 3600000%>">03</option>
	 				<option value="<%= 4 * 3600000%>">04</option>
	 				<option value="<%= 5 * 3600000%>">05</option>
	 				<option value="<%= 6 * 3600000%>">06</option>
	 				<option value="<%= 7 * 3600000%>">07</option>
	 				<option value="<%= 8 * 3600000%>">08</option>
	 				<option value="<%= 9 * 3600000%>">09</option>
	 				<option value="<%= 10 * 3600000%>">10</option>
	 				<option value="<%= 11 * 3600000%>">11</option>
	 				<option value="<%= 12 * 3600000%>">12</option>
	 				<option value="<%= 13 * 3600000%>">13</option>
	 				<option value="<%= 14 * 3600000%>">14</option>
	 				<option value="<%= 15 * 3600000%>">15</option>
	 				<option value="<%= 16 * 3600000%>">16</option>
	 				<option value="<%= 17 * 3600000%>">17</option>
	 				<option value="<%= 18 * 3600000%>">18</option>
	 				<option value="<%= 19 * 3600000%>">19</option>
	 				<option value="<%= 20 * 3600000%>">20</option>
	 				<option value="<%= 21 * 3600000%>">21</option>
	 				<option value="<%= 22 * 3600000%>">22</option>
	 				<option value="<%= 23 * 3600000%>">23</option>
				</select>:
				<select id="minuteTo">
					<option value="<%= 0 * 60000%>">00</option>
	 				<option value="<%= 5 * 60000%>">05</option>
	 				<option value="<%= 10 * 60000%>">10</option>
	 				<option value="<%= 15 * 60000%>">15</option>
	 				<option value="<%= 20 * 60000%>">20</option>
	 				<option value="<%= 25 * 60000%>">25</option>
	 				<option value="<%= 30 * 60000%>">30</option>
	 				<option value="<%= 35 * 60000%>">35</option>
	 				<option value="<%= 40 * 60000%>">40</option>
	 				<option value="<%= 45 * 60000%>">45</option>
	 				<option value="<%= 50 * 60000%>">50</option>
	 				<option value="<%= 55 * 60000%>">55</option>
				</select>
				</div>
			</div>
			<div id="save_repeat_date_change" class="button-class"><spring:message code="label.edit"></spring:message></div>
		</div>
	</div>
</div>


